/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-06-28
 * Time: 10:28
 */
public class test3 {
    public int subarraySum(int[] nums, int k) {
        int n = nums.length;
        int count=0;
        for(int left = 0;left<n;left++){
            int sum = 0;
            for(int right=left;right>=0;right--){
                sum += nums[right];
                if(sum==k){
                    count++;
                }
            }
        }
        return count;
    }
}
